# from rest_framework.views import APIView
# from rest_framework.response import Response
# from system.SysUtils.permission import permission_required
#
#
# class UserManagementView(APIView):
#     """用户管理视图示例"""
#
#     @permission_required(["sys:user:query"])
#     def get(self, request):
#         """获取用户列表，需要 sys:user:list 权限"""
#         # 业务逻辑...
#         return Response({
#             "code": "00000",
#             "data": {"users": [...]},
#             "msg": "获取用户列表成功"
#         })
#
#     @permission_required(["sys:user:add"])
#     def post(self, request):
#         """新增用户，需要 sys:user:add 权限"""
#         # 业务逻辑...
#         return Response({
#             "code": "00000",
#             "data": {"userId": 1},
#             "msg": "添加用户成功"
#         })
#
#     @permission_required(["sys:user:edit"])
#     def put(self, request):
#         """修改用户，需要 sys:user:edit 权限"""
#         # 业务逻辑...
#         return Response({
#             "code": "00000",
#             "data": None,
#             "msg": "修改用户成功"
#         })
#
#     @permission_required(["sys:user:delete"])
#     def delete(self, request):
#         """删除用户，需要 sys:user:delete 权限"""
#         # 业务逻辑...
#         return Response({
#             "code": "00000",
#             "data": None,
#             "msg": "删除用户成功"
#         })
#
#
# class ComplexOperationView(APIView):
#     """需要多个权限的复杂操作示例"""
#
#     @permission_required(["sys:user:edit", "sys:role:assign"])
#     def post(self, request):
#         """分配角色给用户，需要同时拥有用户编辑和角色分配权限"""
#         # 业务逻辑...
#         return Response({
#             "code": "00000",
#             "data": None,
#             "msg": "角色分配成功"
#         })
